#ifndef RAY_TRACE_PRO_RENDER_BUFFER_H
#define RAY_TRACE_PRO_RENDER_BUFFER_H

#include "Basic/GxLibBasic.h"
#include "VectorMath.h"

namespace RayTracePro
{
	class RenderBuffer
	{
	public:
		int Width, Height;
		GxLibBasic::Array<GxLibMath::Vec4, true> Buffer;
		RenderBuffer()
		{
			Width = Height = 0;
		}
		inline void SetSize(int w, int h)
		{
			Width = w;
			Height = h;
			Buffer.SetSize(w * h);
		}
		inline void SetPixel(int x, int y, const GxLibMath::Vec4 & pix)
		{
			Buffer[y * Width + x] = pix;
		}
		inline GxLibMath::Vec4 & GetPixel(int x, int y)
		{
			return Buffer[y * Width + x];
		}
		void SavePFM(const wchar_t * fileName);
	};
}

#endif